<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>test</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
</head>
<body>
    <div id="box">
        <img src="https://img2.baidu.com/it/u=2054114667,923284312&fm=253&fmt=auto&app=138&f=JPEG?w=700&h=495" alt="" @mouseover="mouseoverorout(1)" @mouseout="mouseoverorout(0)">
        <img src="https://img2.baidu.com/it/u=2054114667,923284312&fm=253&fmt=auto&app=138&f=JPEG?w=700&h=495" alt="" @mouseover="mouseoverorout(1)" @mouseout="mouseoverorout(0)">
    </div>

    <script>
        new Vue({
            el:'#box',
            data:{

            },
            methods:{
                mouseoverorout(i){
                    if(i==1){
                        event.target.style.opacity=1
                    }else{
                        event.target.style.opacity=0.5
                    }
                }
            }
        })
    </script>
</body>
</html>